from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select
from time import sleep
from postion import options
from postion import service

driver = webdriver.Chrome(options=options,service=service)
driver.get(r'http://172.16.36.120:8080/bsams/front/login.do')
sleep(3)
id=1
username='test18'
password='123456'
vailcode='shtd'
driver.find_element(By.ID,'taskId').send_keys(id)
driver.find_element(By.ID,'loginName').send_keys(username)
driver.find_element(By.ID,'password').send_keys(password)
driver.find_element(By.ID,'vericode').send_keys(vailcode)
driver.find_element(By.XPATH,'//*[@id="fmedit"]/div[2]/div[6]/input').click()
sleep(3)

driver.find_element(By.XPATH,'//*[@id="leftmenu_asset_manage"]/div[2]/a').click()
sleep(3)
ele=driver.find_element(By.ID,'status')
#选择使用
Select(ele).select_by_value('1')
sleep(2)
#选择未使用
Select(ele).select_by_index(2)
sleep(2)
Select(ele).select_by_visible_text('全部状态')
sleep(2)

driver.quit()

